package entity

type User struct {
	Id       int64  `gorm:"column:id;primary_key" json:"id"`
	Username string `gorm:"column:username;type:varchar(255);not null" json:"username"`
	Password string `gorm:"column:password;type:varchar(255);not null" json:"password"`
	Salt     string `gorm:"column:salt;type:varchar(255);not null" json:"salt"`
	Nickname string `gorm:"column:nickname;type:varchar(255);not null" json:"nickname"`
	Email    string `gorm:"column:email;type:varchar(255);not null" json:"email"`
	Phone    string `gorm:"column:phone;type:varchar(255);not null" json:"phone"`

	RoleID      int64 `gorm:"column:role_i_d;type:bigint;not null" json:"role_i_d"`
	Status      int   `gorm:"column:status;type:integer;not null" json:"status"`
	ActiveState int   `gorm:"column:active_state;type:integer;not null" json:"active_state"`
	LastLoginAt int64 `gorm:"column:last_login_at;type:bigint;not null" json:"last_login_at"`
	CreatedAt   int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"`
	UpdatedAt   int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"`
}

func (u *User) TableName() string {
	return "t_user"
}
